package com.ruoyi.web.service.Impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.MesMachineCarereationMapper;
import com.ruoyi.web.domain.mes.MesMachineCarereation;
import com.ruoyi.web.service.IMesMachineCarereationService;

import javax.annotation.Resource;

/**
 * 设备计划关联Service业务层处理
 * 
 * @author levicash
 * @date 2024-01-17
 */
@Service
public class MesMachineCarereationServiceImpl implements IMesMachineCarereationService 
{
    @Resource
    private MesMachineCarereationMapper mesMachineCarereationMapper;

    /**
     * 查询设备计划关联
     * 
     * @param id 设备计划关联主键
     * @return 设备计划关联
     */
    @Override
    public MesMachineCarereation selectMesMachineCarereationById(Long id)
    {
        return mesMachineCarereationMapper.selectMesMachineCarereationById(id);
    }

    /**
     * 查询设备计划关联列表
     * 
     * @param mesMachineCarereation 设备计划关联
     * @return 设备计划关联
     */
    @Override
    public List<MesMachineCarereation> selectMesMachineCarereationList(MesMachineCarereation mesMachineCarereation)
    {
        return mesMachineCarereationMapper.selectMesMachineCarereationList(mesMachineCarereation);
    }

    /**
     * 新增设备计划关联
     * 
     * @param mesMachineCarereation 设备计划关联
     * @return 结果
     */
    @Override
    public int insertMesMachineCarereation(MesMachineCarereation mesMachineCarereation)
    {
        mesMachineCarereation.setCreateBy(SecurityUtils.getUsername());
        mesMachineCarereation.setCreateTime(DateUtils.getNowDate());
        return mesMachineCarereationMapper.insertMesMachineCarereation(mesMachineCarereation);
    }

    /**
     * 修改设备计划关联
     * 
     * @param mesMachineCarereation 设备计划关联
     * @return 结果
     */
    @Override
    public int updateMesMachineCarereation(MesMachineCarereation mesMachineCarereation)
    {
        mesMachineCarereation.setUpdateBy(SecurityUtils.getUsername());
        mesMachineCarereation.setUpdateTime(DateUtils.getNowDate());
        return mesMachineCarereationMapper.updateMesMachineCarereation(mesMachineCarereation);
    }

    /**
     * 批量删除设备计划关联
     * 
     * @param ids 需要删除的设备计划关联主键
     * @return 结果
     */
    @Override
    public int deleteMesMachineCarereationByIds(Long[] ids)
    {
        return mesMachineCarereationMapper.deleteMesMachineCarereationByIds(ids);
    }

    /**
     * 删除设备计划关联信息
     * 
     * @param id 设备计划关联主键
     * @return 结果
     */
    @Override
    public int deleteMesMachineCarereationById(Long id)
    {
        return mesMachineCarereationMapper.deleteMesMachineCarereationById(id);
    }
}
